package com.newasia.management.dto.user.role;

import com.newasia.commons.result.AbstractRequest;
import com.newasia.commons.tool.exception.ValidateException;
import com.newasia.management.constants.ManagementRetCode;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;

@Data
public class UpdateSysRoleRequset extends AbstractRequest{

    /**
     * 角色ID
     */
    private Long roleId;
    /**
     * 角色名称
     */
    private String roleName;

    private List<Long> menuIds;

    @Override
    public void requestCheck() {
        if(menuIds==null){
            menuIds = new ArrayList<Long>();
        }
        if(roleId==null){
            throw new ValidateException(
                    ManagementRetCode.REQUEST_CHECK_FAILURE.getCode(),
                    ManagementRetCode.REQUEST_CHECK_FAILURE.getMessage());
        }
    }
}
